Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WIP: add option to disable versioning in EOS upon PUT request #4864

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

jessegeens
Copy link
Contributor

@jessegeens jessegeens commented Sep 24, 2024

Fix for #4855

This PR introduces a new HTTP header for PUT requests, X-Disable-Versioning. When this header is added to a PUT request, the EOS storage driver will turn off versioning for this particular save. This is particularly useful for applications that perform automatic saves every x minutes: disabling versioning on these automatic saves ensures that the version history of these files is not polluted

Copy link

update-docs bot commented Sep 24, 2024

Thanks for opening this pull request! The maintainers of this repository would appreciate it if you would create a changelog item based on your changes.

@jessegeens jessegeens force-pushed the feature/disable-versioning branch 2 times, most recently from 41e988f to a1186bd Compare September 30, 2024 09:34
Copy link
Contributor

@diocas diocas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

First commit! Thanks.

I've made some comments. Please clean up the commit history to split the feature (and its tests) and all the other things you had to do to be able to do the tests (like updates and registering the gw?).
I'm not able to evaluate if the tests are ok like this. I'll wait for more knowledgeable people.

changelog/unreleased/disable-versioning.md Show resolved Hide resolved
pkg/eosclient/eosbinary/eosbinary.go Outdated Show resolved Hide resolved
pkg/eosclient/eosgrpc/eoshttp.go Outdated Show resolved Hide resolved
pkg/rgrpc/todo/pool/pool.go Show resolved Hide resolved
@jessegeens jessegeens force-pushed the feature/disable-versioning branch 6 times, most recently from b7a8ad1 to 0a396f9 Compare October 4, 2024 08:06
@jessegeens jessegeens force-pushed the feature/disable-versioning branch 3 times, most recently from c218967 to 63387a0 Compare October 4, 2024 08:40
Jesse Geens added 2 commits October 23, 2024 09:12
Implemented a new function to register a GatewayServiceClient. Previously, this could only be done by passing an actual connection. However, that is unnecessarily limiting. Introducing the RegisterGatewayServiceClient allows us to register mocked gateways for unit testing
This commit introduces a new header, `X-Disable-Versioning`, that is available on PUT requests. This header will disable versioning for this file save if the storage backend is EOS.

Additionally, this commit introduces two unit tests related to this functionality:
- TestDisableVersioningLeadsToCorrectQueryParams: test whether disabling versioning leads to correct query parameteers for the EOS HTTP / GRPC client
- TestDisableVersioningHeaderPassedAlong: test whether a header passed to the initial endpoint is propagated to the actual upload endpoint

Finally, this commit also fixes a bug that was already present, where
the app was not passed along in the case of token-based authz
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants